package tools.IT;

public class spectre {

	private char[] alphabet;
	private int depth;
	private int[][] spectre;
	
	/**
	 * Sets parameters to values defined in standard.java
	 *
	 */
	public spectre(){
		this(standard.getAlphabet(),standard.getSpectre_depth());
	}
	public spectre(int depth){
		this(standard.getAlphabet(),depth);
	}
	public spectre(char[] alphabet){
		this(alphabet,standard.getSpectre_depth());
	}
	public spectre(char[] alphabet,int depth){
		this.alphabet=alphabet;
		this.depth=depth;
		spectre=new int[depth][];
		for(int i=0,j=this.alphabet.length;i<depth;i++,j*=this.alphabet.length)
			spectre[i]=new int[j];
	}
	public void add(int wordLength,int value){
		spectre[wordLength-1][value]++;
	}
	public void add(String word){
		this.add(word.length(),operation.wordValue(word,this.alphabet));
	}
}
